public class 求数组中的最大值 {
    public static void main(String[] args) {
        int[] i1 = {1,2,3,4,5,6,3,-3,10,21,12};
        int max =0;
        int maxindex=0;
        for (int i = 0; i < i1.length; i++) {
            if(max<i1[i]){
                max=i1[i];
                maxindex=i;
            }
        }
        System.out.println(max);
        System.out.println("下标是"+maxindex);
    }
}
